import { request, hotelRequest } from '@/sheep/request';

export default {
  // 获取优惠卷套餐列表
  coupon_list: (params) =>
    request({
      url: '/hotel/api/coupon/list',
      method: 'GET',
      params,
    }),

  // 创建优惠券套餐订单
  create_coupon_order: (data) =>
    request({
      url: `/hotel/api/coupon/create`,
      method: 'POST',
      data: {
        ...data,
      },
    }),

  // 酒店列表 社群使用
  getPromotionInfo: (params) =>
    request({
      url: '/shop/api/goods/hotel/getHotel',
      method: 'GET',
      params,
    }),

  // 打车登录 生成code
  dache_code: (params) =>
    request({
      url: '/trip/api/auth2/code',
      method: 'GET',
      params,
    }),

  // 创建订单
  dache_create: (data) =>
    request({
      url: `/trip/api/order/create`,
      method: 'POST',
      data: {
        ...data,
      },
    }),

  // 预下单
  dache_pre: (data, id) =>
    request({
      url: `/trip/api/order/pre/` + id,
      method: 'POST',
      data: {
        ...data,
      },
    }),

  // 修改订单 提交支付
  dache_save: (data, id) =>
    request({
      url: `/trip/api/order/save/` + id,
      method: 'POST',
      data: {
        ...data,
      },
    }),

  // 支付
  dache_pay: (data) =>
    request({
      url: `/shop/api/pay/prepay`,
      method: 'POST',
      data: {
        ...data,
      },
    }),

  // 获取酒店日期价格
  date_price: (id) =>
    request({
      url: 'goods/hotel/dayList/' + id,
      method: 'GET',
    }),

  // 获取酒店房间详情
  room_list: (params) =>
    request({
      url: 'goods/hotel/roomDetail',
      method: 'GET',
      params,
    }),

  // 支付
  ticket_pay: (data) =>
    request({
      url: 'pay/prepay',
      method: 'POST',
      data: {
        ...data,
      },
    }),

  // 地区列表
  area_list: (params) =>
    request({
      url: 'data/area',
      method: 'GET',
      params,
    }),

  // 申请入驻
  hotel_apply: (data) =>
    request({
      url: '/hotel/api/apply/apply',
      method: 'POST',
      data: {
        ...data,
      },
    }),

  // 验证码

  sendSms: (data) =>
    request({
      url: 'sendSms',
      method: 'POST',
      data: {
        ...data,
      },
    }),

  // 装修贷
  zxd_apply: (data) =>
    request({
      url: '/hotel/api/loans/apply',
      method: 'POST',
      data: {
        ...data,
      },
    }),

  // 获取酒店房间详情
  jdjr_info: (type) => {
    // 装修贷款
    if (type == 'zxd') {
      return request({
        url: '/hotel/api/loans',
        method: 'GET',
        params: { type: "fitment" },
      });
      // 经营贷
    } else if (type == 'jyd') {
      return request({
        url: '/hotel/api/loans',
        method: 'GET',
        params: { type: "manage" },
      });

      //供应链置换
    } else if (type == 'gylzh') {
      return request({
        url: '/hotel/api/permutation',
        method: 'GET'
      });

      //空置房变现
    } else if (type == 'kzfbx') {
      return request({
        url: '/hotel/api/cash',
        method: 'GET'
      });
    }
  },




  // 供应链置换
  gylzh_apply: (data) =>
    request({
      url: '/hotel/api/permutation/apply',
      method: 'POST',
      data: {
        ...data,
      },
    }),

  //空置房变现
  kzfhqx_apply: (data) =>
    request({
      url: '/hotel/api/cash/apply',
      method: 'POST',
      data: {
        ...data,
      },
    }),
};
